import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2024-05-26
 * Time: 17:51
 */

public class Test {
    public static int fib(int n ){
        if(n == 1){
            return 0;
        }
        if(n == 2){
            return 1;
        }
        return fib(n - 2) + fib( n - 1);
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        System.out.println(fib(n));
    }
    public static int func(int n ){
        if(n < 10){
            return n;
        }
        return func(n/10) + n % 10;
        }

    public static void main21(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        System.out.println(func(n));
    }



    public static int add(int x, int y) {
        return x + y;
    }

    public static double add(double x, double y) {
        return x + y;
    }

    public static void main15(String[] args) {
        int a = 10;
        int b = 20;
        System.out.println(add(a, b));
        System.out.println("============");
        double c = 22.5;
        double d = 43.5;
        System.out.println(add(c, d));
    }


    public static int addInt(int x, int y) {
        return x + y;
    }

    public static double addDouble(double x, double y) {
        return x + y;
    }

    public static void main14(String[] args) {
        int a = 10;
        int b = 20;
        System.out.println(addInt(a, b));
        System.out.println("============");
        double c = 22.5;
        double d = 43.5;
        System.out.println(addDouble(c, d));
    }

        public static void swap(int a ,int b ){
            int tmp = a;
            a = b;
            b = tmp;
        }
        public static void main13(String[] args) {
            int a = 10;
            int b = 20;
            System.out.println("交换前：" + a + " " + b);
            swap(a , b);
            System.out.println("交换前：" + a + " " + b);
        }

        public static void main11(String[] args) {
            int a = 10;
            int b = 20;
            int tmp = a;
            a = b;
            b = tmp;
            System.out.println(a + " " + b);
        }
        public static int fac(int n ){
            int ret = 1;
            for (int i = 1; i <= n; i++) {
                ret *= i;
            }
            return ret;
        }

        public static int facSum(int n){
            int sum = 0;
            for (int i = 1; i <= n ; i++) {
                sum += fac(5);
            }
            return sum;
        }
        public static void main9(String[] args) {
            System.out.println(fac(5));
            System.out.println(facSum(6));
        }
    public static int sum(int num1,int num2){
        return num1 +num2;
    }

    public static void main10(String[] args) {
        Scanner scan = new Scanner(System.in);
        while (scan.hasNextInt()){
            int num1 = scan.nextInt();
            int num2 = scan.nextInt();
            int ret = sum(num1,num2);
            System.out.println(ret);
        }
    }

    public static void isLeapYear(int year){
        if(year % 100 == 0){
            if(year % 400 == 0){
                System.out.println(year + " is_leap_year");
            }else {
                if(year % 4 == 0){
                    System.out.println(year + " is_leap_year");
                }
            }
        }else{
            System.out.println(year + " is_not_leap_year");
        }
    }
    public static void main12(String[] args) {
        Scanner scan = new Scanner(System.in);
        int year = scan.nextInt();
        isLeapYear(year);
        scan.close();
    }




    public static void main5(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num1 = scanner.nextInt();
        int num2 = scanner.nextInt();
        int ret = num1 % num2;
        while (ret != 0) {
            num1 = num2;
            num2 = ret;
            ret = num1 % num2;
        }
        System.out.println(num2);
    }


    public static void main8(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int ret = scanner.nextInt();
        int i = 30;
        while (i >= 0) {
            System.out.print(((ret >> i) & 1) + " ");
            i -= 2;
        }
        System.out.println();
        i = 31;
        while (i > 0) {
            System.out.print(((ret >> i) & 1) + " ");
            i -= 2;
        }
    }


    public static void main6(String[] args) {
        int count = 3;
        Scanner scanner = new Scanner(System.in);
        String password = "abcdsf";
        while(count != 0){
            System.out.println("请输入密码：你还有" + count + "次机会");
            String str = scanner.nextLine();
            if(str.equals(password)){
                System.out.println("登陆成功");
                break;
            }else {
                System.out.println("密码输入错误");
                count--;
            }
        }
    }



    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()){
            int ret = scanner.nextInt();
        for (int i = 0; i < ret; i++) {
            for (int j = 0; j < ret; j++) {
                if (i == j || (i + j == ret - 1)) {
                    System.out.print("*");
                } else {
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }
}





    public static void main1(String[] args) {
        double sum = 0.0;
        int flag = 1;
        for (int i = 1; i <= 100; i++) {
            sum += 1.0 / i * flag;
            flag = -flag;
        }
        System.out.println(sum);
    }



    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int ret = scanner.nextInt();
        int count = 0;
        while (ret != 0){
           ret = ret & (ret - 1);
           count++;
        }
        System.out.println(count);
        scanner.close();
    }
}
